import { time } from '@/utils/performance'
import { selectionSort as s } from '../selectionSort'
import { isSorted, randomArr } from '../util'

export const test = () => {
    const arr = randomArr(0, 30000, 29000),
          arr2 = arr.slice()
    time("二叉堆", () => {
        s(arr)
    })
    p(arr)

    time("selectionSort", () => {
        s(arr2);
    })
    p(arr2)
}



const p = (arr: number[]) => {
    console.log(isSorted(arr))
}